package com.gl.framework.core.exception;

import com.gl.framework.web.response.ResultCode;

public class BizException extends RuntimeException {
    private static final long serialsVerionUID = 1L;

    private Integer code;
    private String msg;
    private String message;

    public BizException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public BizException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = ResultCode.FAIL.getCode();
    }

    public BizException(Integer code, String msg) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public BizException(Integer code, String msg, Throwable e) {
        super(msg, e);
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
